<?php

/**
 * Contatti form.
 *
 * @package    Moncada
 * @subpackage form
 * @author     Federico Motta - Andrea Burza
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ContattiForm extends BaseContattiForm
{
  public function configure()
  {
	 $this->setWidgets(array(
      'posizione'   => new sfWidgetFormInputText(),
      'nome'   => new sfWidgetFormInputText(),
      'email'   => new sfWidgetFormInputText(),
      'phone'   => new sfWidgetFormInputText(),
      'foto'   => new sfWidgetFormInputText()
    ));
	 
	 $this->validatorSchema['email'] = new sfValidatorEmail();
	 
	$this->widgetSchema['foto'] = new sfWidgetFormInputFile(array(
      'label' => 'Company logo',
    ));

	 $this->validatorSchema['foto'] = new sfValidatorFile(array(
	  'required'   => false,
	  'path'       => sfConfig::get('sf_upload_dir').'/contatti',
	  'mime_types' => 'web_images',
	));
  }
}
